load("@batfish//skylark:junit.bzl", "junit_tests")
load("@batfish//skylark:pmd_test.bzl", "pmd_test")
load("@rules_java//java:java_library.bzl", "java_library")

package(
    default_testonly = True,
    default_visibility = ["//visibility:public"],
)

java_library(
    name = "mock_grammar_settings",
    srcs = [":MockGrammarSettings.java"],
    deps = [
        "//projects/batfish-common-protocol:parser_common",
        "@maven//:com_google_code_findbugs_jsr305",
    ],
)

pmd_test(
    name = "mock_grammar_settings_pmd",
    lib = ":mock_grammar_settings",
)

junit_tests(
    name = "tests",
    srcs = glob(["*Test.java"]),
    resources = ["//projects/batfish-common-protocol/src/test/resources/org/batfish/grammar"],
    deps = [
        "//projects/batfish-common-protocol:common_lib",
        "//projects/batfish-common-protocol:common_testlib",
        "//projects/batfish-common-protocol:parser_common",
        "//projects/batfish-common-protocol/src/test/antlr4/org/batfish/grammar/recovery",
        "//projects/batfish-common-protocol/src/test/java/org/batfish/common/matchers",
        "//projects/batfish-common-protocol/src/test/java/org/batfish/grammar/recovery:recovery_testlib",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:junit_junit",
        "@maven//:org_antlr_antlr4_runtime",
        "@maven//:org_hamcrest_hamcrest",
    ],
)
